package com.djmw.mouse.solr;

import org.apache.solr.client.solrj.SolrServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.djmw.mouse.entity.PositionSolr;

@Component
public class PositionDaoSolr {

    @Autowired
    SolrHelper solrHelper;

    public void save(PositionSolr entity) {
        SolrServer server = solrHelper.getDefaultServer();
        try {
            server.addBean(entity);
            server.commit();
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }

}
